Skip to content

Conversation

@thisismana
Copy link
Contributor

@thisismana thisismana commented Sep 5, 2025

This pull request introduces advanced and more flexible CloudWatch Logs configuration options for AWS Lambda functions in the Terraform module. It allows users to define custom log group names, reuse existing log groups, set advanced logging configurations, and manage log group lifecycle behavior. The documentation and examples have also been updated to reflect these enhancements.

CloudWatch Logs Configuration Enhancements:

  • Added support for advanced logging configuration via a new logging_config input, allowing custom log group names, log formats, and log levels to be specified for Lambda functions. [1] [2] [3]
  • Introduced the ability to reuse existing CloudWatch log groups by setting create_cloudwatch_log_group = false, with the module now able to detect and use external log groups. [1] [2] [3]
  • Added new inputs: cloudwatch_logs_log_group_class, cloudwatch_logs_skip_destroy, and create_cloudwatch_log_group to control log group class, deletion behavior, and resource management, respectively.
  • Updated IAM permissions and log subscription filter handling to work with both managed and external log groups. [1] [2]

Documentation and Examples:

  • Significantly expanded the README.md with clearer explanations, updated examples, and new references to advanced logging features and configuration options. [1] [2] [3]
  • Added a new example under examples/cloudwatch-logs demonstrating advanced logging configuration, log group reuse, and log subscription filters, along with supporting files and outputs. [1] [2] [3] [4] [5]
  • Updated the Lambda Insights example to use a more recent Node.js runtime version in the documentation.

These changes provide users with greater flexibility and control over Lambda logging, making the module more adaptable to complex infrastructure requirements.

References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Copy link

@bastianpahlke bastianpahlke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for configuring AWS Lambda logging settings through a new logging_config variable. The change allows users to specify log format (JSON or Text), application log level, system log level, and log group for Lambda functions.

  • Added logging_config variable with validation for log format
  • Implemented dynamic logging configuration blocks in both Lambda resources
  • Updated example to demonstrate JSON logging with INFO/WARN levels

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
variables.tf Adds new logging_config variable with object type and validation
main.tf Implements dynamic logging_config blocks for both Lambda resources
examples/fixtures/context/index.js Updates example function to use different log levels
examples/complete/main.tf Adds example logging configuration
README.md Documents the new logging_config input parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

This comment was marked as resolved.

@moritzzimmer moritzzimmer added the 📖 documentation Improvements or additions to documentation label Sep 24, 2025
@moritzzimmer moritzzimmer changed the title feat: added lambda logging config feat: advanced logging config Sep 24, 2025

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@moritzzimmer moritzzimmer merged commit a5dd33a into moritzzimmer:main Sep 26, 2025
9 checks passed
@moritzzimmer
Copy link
Owner

this PR is released with 8.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation 💅 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants